<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class AdminConfig extends Model
{

	use HasDateTimeFormatter;

    protected $table = 'admin_config';

    // 追加到模型数组表单的访问器
    protected $appends = ['http_image'];

    // 图片地址拼接域名前缀
    public function getHttpImageAttribute()
    {
        return $this->image ? config('filesystems.disks.public.url') . $this->image : null;
    }

    public function getList($where = [], $select = ['*'])
    {
        return $this->newQuery()
            ->select($select)
            ->where($where)
            ->get();
    }

}
